home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1996 #5 / Amiga Plus CD - 1996 - No. 5.iso / pd / texte / thor_api / include / libraries / bbsread.h next >
Encoding:
C/C++ Source or Header  |  1995-09-09  |  34.8 KB  |  804 lines

  1. #ifndef LIBRARIES_BBSREAD_H
  2. #define LIBRARIES_BBSREAD_H
  3. /*
  4. **  $VER: BBSRead.h 4.1 (18.06.95)
  5. ** 
  6. **  BBSRead structures and definitions.
  7. **
  8. **  © Copyright 1995 Ultima Thule Software
  9. **  All Rights Reserved.
  10. **
  11. **  Author: Eivind Nordseth
  12. */
  13.  
  14. #ifndef EXEC_TYPES_H
  15. #include <exec/types.h>
  16. #endif
  17. #ifndef EXEC_NODES_H
  18. #include <exec/nodes.h>
  19. #endif
  20. #ifndef EXEC_LISTS_H
  21. #include <exec/lists.h>
  22. #endif
  23. #ifndef LIBRARIES_BBSREADTAGS_H
  24. #include <libraries/BBSReadTags.h>
  25. #endif
  26.  
  27.  
  28. #define BBSREADNAME        "bbsread.library"
  29. #define BBSREADVERSION    4L
  30.  
  31. #define ENV_BBSDATAPATH        "THOR/BBSDataPath"
  32. #define ENV_THORPATH            "THOR/THORPath"
  33.  
  34.  
  35. /***********************************************************************
  36. *
  37. * Global config structures and definitions
  38. *
  39. */
  40.  
  41. struct ArcConfigItem
  42. {
  43.     struct Node ac_Node;
  44.     UWORD    sc_pad;
  45.     STRPTR ac_Name;            /* Name of this archiver                */
  46.     STRPTR ac_FindPatern;    /* Patern to identify this archiver    */
  47.     STRPTR ac_UnArcCmd;        /* Command to unarc an archive        */
  48.     STRPTR ac_ArcCmd;            /* Command to add to an archive                    */
  49.     ULONG  ac_OpenCnt;        /* Nr of types using this archiver. Private.    */
  50. };
  51.  
  52. struct GlobalConfig
  53. {
  54.     STRPTR gc_DnloadPath;    /* Path where downloaded files resides        */
  55.     STRPTR gc_UploadPath;    /* Path where files to upload resides        */
  56.     STRPTR gc_GlobalUserName;    /* Global user name.    (from key file)    */
  57.  
  58.     ULONG gc_Buffers;            /*    Number of buffers to use                */
  59.     ULONG gc_BufferSize;        /* Size of each buffer                        */
  60.  
  61.     STRPTR gc_Signature;        /* Global signature, could be a NULL pointer    */
  62.  
  63.     ULONG gc_KeepMsg;            /* Messages to keep in each conference                        */
  64.     ULONG gc_KeepTime;        /* Time (in seconds) to keep messages in conferences    */
  65.  
  66.     LONGBITS gc_Flags;    
  67.  
  68.     struct MinList *gc_AvailArc;    /* List of archivers    which can be used for (un)packing.    */
  69.  
  70.     STRPTR gc_XpkMethod;        /* What xpk method to use when packing                        */
  71.  
  72.     STRPTR gc_UserStreet;    /* User data from key file.        */
  73.     STRPTR gc_UserAddress;
  74.     STRPTR gc_UserCountry;
  75.     STRPTR gc_UserPhone;        /* User editable.                                */
  76.  
  77.     STRPTR gc_TmpDir;            /* Directory to use for temp files while packing    */
  78.     STRPTR gc_TagFile;        /* Global tag file. NULL-pointer, no tags                */
  79.     
  80.     ULONG gc_HazeLevel1;        /* Seconds to keep messages marked with hazelevel 1    */
  81.     ULONG gc_HazeLevel2;        /* Seconds to keep messages marked with hazelevel 2    */
  82.     ULONG gc_HazeLevel3;        /* Seconds to keep messages marked with hazelevel 3    */
  83.     
  84.     STRPTR gc_PGPCommand;    /* Command for pgp (Default is "(ENV:PGPPATH)pgp")                    */
  85.     STRPTR gc_PGPSignID;    /* Id to use when PGP signing messages. Default is '*'.            */ 
  86.  
  87.     STRPTR gc_ReplyString;    /* Reply string to use when a message is replied _and_ moved.    */
  88.  
  89.     STRPTR gc_StartupScript;/* Arexx script to be run each time Thor is started.    */
  90.     STRPTR gc_QuitScript;    /* Arexx script to be run each time Thor is quited.    */
  91.  
  92.     STRPTR gc_BBSEnterScript;    /* Arexx script to be run each time a bbs is entered.        */
  93.     STRPTR gc_BBSLeaveScript;    /* Arexx script to be run each time a bbs is left.            */
  94.  
  95.     STRPTR gc_ConfEnterScript;    /* Arexx script to be run each time a conf is entered.    */
  96.     STRPTR gc_ConfLeaveScript;    /* Arexx script to be run each time a conf is left.        */
  97.     UBYTE  gc_QuoteChars[4];    /* String to use as quote chars in custom quote type.    */
  98.                                         /* Max length is 3. The string is NUL terminated.         */
  99. };
  100.  
  101. /*  GlobalConfig.gc_Flags  */
  102. #define GCF_IGNORE_KEEPMSG        (1<<0)    /* gc_KeepMsg is ignored. Messages won't     */
  103.                                                     /*    be counted when packing conferences        */
  104. #define GCF_IGNORE_KEEPTIME    (1<<1)    /* gc_KeepTime is ignored.    Time won't be    */
  105.                                                     /* checked when packing conferences                */
  106. #define GCF_RESET_EVENT_NR        (1<<2)    /* Reset event numbers when packing events.    */
  107. #define GCF_NO_XPK_METHOD        (1<<3)    /* Don't use any xpk method                        */
  108. #define GCF_FILE_SIGNATURE        (1<<4)    /* The gc_Signature field contains the path    */
  109.     /* and name of a file containing the signature.                                                */
  110. #define GCF_AUTO_XPK_PACK        (1<<5)    /* Automatically xpk pack all new messages     */
  111.     /* when are written to the database. NB: A xpk method must have been defined.        */
  112. #define GCF_FORCE_PACK_REWRITE (1<<6)    /* Force a rewrite when packing conferences    */
  113. #define GCF_COMMAND_SIGNATURE    (1<<7)    /* The gc_Signature field contains the path    */
  114.     /* and name of a command. When the command is executed should the signature         */
  115.     /* contents be written to stdout. The template for the command is expected to be */    
  116.     /* BBSNAME/K,CONFNAME/K.                                                                             */
  117. #define GCF_ALWAYS_REPLY_STR    (1<<8)     /* Use reply string on all replies.             */
  118.  
  119.  
  120. /***********************************************************************
  121. *
  122. * BBSType structures and definitions
  123. *
  124. */
  125.  
  126. struct EventConfigItem
  127. {
  128.     struct MinNode ec_Node;
  129.     
  130.     ULONG    ec_Event;        /*    Identification of this event                                    */
  131.     ULONG *ec_NeedTags;    /* Pointer to TAG_END-terminated array of tags needed        */
  132.                                 /* for this event    (NULL pointer -> no needed tags)            */
  133.     ULONG *ec_OptTags;    /* Pointer to TAG_END-terminated array of optional    tags    */
  134.                                 /* for this event    (NULL pointer -> no optional tags)        */
  135.     ULONG    ec_Reserved;    /* Reserved for future expansion                                    */
  136. };
  137.  
  138.  
  139. /*  Structure holding BBS-type spesific data  */
  140.  
  141. struct TypeData
  142. {
  143.     STRPTR td_TypeName;            /* Name of BBS-type                                    */
  144.     STRPTR td_MsgParser;            /* Command for parsing grabs                        */
  145.     UWORD  td_LineLength;        /* Max length of lines in messages                */
  146.     UWORD  td_SubjectLength;    /* Max length of subjects                            */
  147.     UWORD  td_FileDescrLen;        /* Max length of short filedescription            */
  148.     UBYTE  td_CharSet;            /* Charset the grab from this BBS typr uses.    */
  149.                                         /* Se bellow for definitions                        */    
  150.     UBYTE    td_QuoteType;        /* Prefered quote type for this bbstype.         */
  151.                                         /* See below for definitions.                        */
  152.     LONGBITS td_AvailScrFlags;    /* Mask of flags script uses                        */
  153.     UWORD    td_FileNameLen;    /* Max length of filenames allowed                */
  154.     UWORD    td_pad2;
  155.     STRPTR   td_EventPacker;    /* Command for packing events                        */
  156.     STRPTR    td_EventArchiver;    /* Archiver to use when making packages        */
  157.  
  158.     struct MinList *td_AvailEvents;    /* List of struct EventConfigItem        */
  159.     
  160.     LONGBITS td_Flags;
  161.     STRPTR   td_AcceptPattern;    /* Pattern for accepting grabs for this bbstype */
  162.                                         /* NULL equals #?                                            */
  163.     STRPTR   td_InitMsgFile;    /* Command for initializing message files            */
  164.     STRPTR   td_ExtConfig;        /* Command for external configuration                        */
  165. };
  166.  
  167. /* Charsets defined */
  168. #define BRCS_ANY        0    /* Any charset, can't be used in BBSTypes.                    */
  169. #define BRCS_ISO        1    /* ISO Latin 1 charset.                                                */
  170. #define BRCS_IBN        2    /* IBM charset used in Norway. Same as IBM CodePage 865. */
  171. #define BRCS_SF7        3    /* 7-bit charset. Sweden and Finland.                            */
  172. #define BRCS_NO7        4    /* 7-bit charset. Norway.                                            */
  173. #define BRCS_DE7        5    /* 7-bit charset. Denmark.                */
  174. #define BRCS_US7        6    /* 7-bit charset. USA.                    */
  175. #define BRCS_UK7        7    /* 7-bit charset. United Kingdom.    */
  176. #define BRCS_IT7        8    /* 7-bit charset. Italia.                */
  177. #define BRCS_PO7        9    /* 7-bit charset. Portugal.            */
  178. #define BRCS_SP7        10    /* 7-bit charset. Espania.                */
  179. #define BRCS_GE7        11    /* 7-bit charset. Germany.                */
  180. #define BRCS_FR7        12    /* 7-bit charset. France.                                            */
  181. #define BRCS_IBM        13    /* IBM charset. Same as IBM CodePage 437.                        */
  182. #define BRCS_IBMM        14    /* IBM multinational charset. Same as IBM CodePage 850.     */
  183. #define BRCS_APPLE    15    /* Apple charset.                                                        */
  184. #define BRCS_NO_OF    15    /* Number of charset defined.        */
  185.  
  186.  
  187. /* Charset equivalents */
  188. #define BRCS_ISO8859.1        BRCS_ISO
  189.  
  190. #define BRCS_ISO_IR002        BRCS_US7
  191. #define BRCS_ISO_IR004        BRCS_UK7
  192. #define BRCS_ISO_IR010        BRCS_SF7
  193. #define BRCS_ISO_IR011        BRCS_SF7
  194. #define BRCS_ISO_IR015        BRCS_IT7
  195. #define BRCS_ISO_IR016        BRCS_PO7
  196. #define BRCS_ISO_IR017        BRCS_SP7
  197. #define BRCS_ISO_IR021        BRCS_GE7
  198. #define BRCS_ISO_IR060        BRCS_NO7
  199. #define BRCS_ISO_IR061        BRCS_NO7
  200. #define BRCS_ISO_IR069        BRCS_FR7
  201.  
  202. #define BRCS_IBM_CP437        BRCS_IBM
  203. #define BRCS_IBM_CP850        BRCS_IBMM
  204. #define BRCS_IBM_CP865        BRCS_IBN
  205.  
  206.  
  207. /*  TypeData.td_AvailScrFlags  */
  208. #define SF_NEWFILES        (1<<0)    /* Do newfiles scan every logon                */
  209. #define SF_AUTOPDNL        (1<<1)    /* Automaticaly download private files        */
  210. #define SF_AUTOLOGOFF    (1<<2)    /* Automaticaly logoff after all is done    */
  211. #define SF_USECOLORS        (1<<3)    /* Use colors on BBS                                */
  212. #define SF_ANSIMENUES    (1<<4)    /* Use ANSI menues                                */
  213. #define SF_BULLETINS        (1<<5)    /* Get new bulletins on every logon            */
  214.  
  215.  
  216. /*  TypeData.td_QuoteType, BBSData.bd_QuoteType, ConfData.cd_QuoteType  */
  217. #define QT_USE_SUPER 0 /* 
  218.     In TypeData.td_QuoteType: Same as QT_DEFAULT.
  219.     In BBSData.bd_QuoteType:  Use quotetype defined for the BBSType.      
  220.     In ConfData.cd_QuoteType: Use quotetype defined for the BBS.          */
  221. #define QT_NONE      1 /* No quoting.                                     */
  222. #define QT_DEFAULT   2 /* Default quote char. (">")                       */
  223. #define QT_DEF_SPACE 3 /* Default quote char pluss space. ("> ")          */
  224. #define QT_CUSTOM    4 /* Custom quote chars defined in QuoteChars field. */
  225. #define QT_INITIALS  5 /* Use initials as quote chars.                    */
  226.  
  227.  
  228. /* TypeData.td_Flags  */
  229. #define TDF_NO_NAME_CHECK        (1<<0)    /* Don't check BBSData->bd_UserName/            */
  230.                                                     /* ConfData->cd_Alias when adding messages    */
  231. #define TDF_NO_ADDR_CHECK        (1<<1)    /* Don't check BBSData->bd_UserAddr when         */
  232.                                                     /* adding messages                                     */
  233. #define TDF_SELECT_ADD_USER    (1<<2)    /* BBSType supports selectable user adding.    */
  234. #define TDF_ADD_USERS            (1<<3)    /* The parser for this eventtype adds users     */
  235.     /* to the user database by default. Used by ConfigBBS() when creatig new BBS'es.    */
  236. #define TDF_ABS_LINELENGTH        (1<<4)    /* The line length in messages from this bbs */
  237.     /* type is never longer than defined for the conf/bbs/bbsttype.                        */
  238. #define TDF_MULTIPLE_CONFS        (1<<5)    /* BBSType supports "conf1,conf2,...,confn"    */
  239.                                                     /* in BREV_Conference tag.                         */
  240. #define TDF_MULTIPLE_TO            (1<<6)    /* BBSType supports "to1,to2,...,ton" in         */
  241.     /* BREV_ToName and/or BREV_ToAddr. If both BREV_ToName and BREV_ToAddr tags are    */
  242.     /* used must name x in BREV_ToName correspond to address x in BREV_ToAddr.            */
  243. #define TDF_REFLOW_QUOTING        (1<<7)    /* Reflow quoting should be on as default     */
  244.                                                     /* when answering messages.                         */
  245. #define TDF_GLOBAL_REPLIES        (1<<8)    /* BRMSG_MsgID or BRMSG_OrginalNr is globaly */
  246.     /* unique and can be used when repling messages to another conference than the     */
  247.     /* orginal.    See BREV_RefConference tag.                                                        */
  248. #define TDF_NAME_REPLIES        (1<<9)    /* It is possible to reply messages to         */
  249.     /* another user than the author of the orginal message.                                    */
  250. #define TDF_REPLY_SUBJ_PREFIX    (1<<10)    /* Use "Re: " as subject prefix on replies.    */
  251. #define TDF_EVENTS_HANDELED    (1<<11)    /* The library shouldn't ask if packed         */
  252.     /* events should be deleted when parsing. This is handled by the event                 */
  253.     /* packer/parser.                                                                                        */
  254. #define TDF_SUPPORTS_ENCODE_8BIT_MAIL    (1<<12)    /* Supports encoding of 8-bit         */
  255.     /* messages only in mail conferences.                                                             */
  256. #define TDF_SUPPORTS_ENCODE_8BIT_MSGS    (1<<13)    /* Supports encoding of 8-bit         */
  257.     /* messages in public conferences.                                                                 */
  258.  
  259.  
  260.  
  261. /*  Structure used in List returned by GetTypeList  */
  262.  
  263. struct TypeListItem
  264. {
  265.     struct Node tl_Node;            /* Caller is free to use nl_Name        */
  266.     WORD        tl_pad;
  267.     APTR        tl_Link;            /* Private!!!!!!!!                                    */
  268.     APTR        tl_UserData;    /* For use by the caller; no restrictions!     */
  269.  
  270.     struct TypeData *tl_Data;    /* Pointer to the Type data                        */
  271. };
  272.  
  273.  
  274. /***********************************************************************
  275. *
  276. * BBS structures and definitions
  277. *
  278. */
  279.  
  280. /*  Structure holding user modifiable BBS data  */
  281.  
  282. struct BBSData
  283. {
  284.     STRPTR bd_Name;        /* Name of BBS                                                                */
  285.     STRPTR bd_GrabName;    /* Name of grabfile (without extension) or with wildcards    */
  286.     STRPTR bd_BBSType;    /* Type of BBS, used when splitting grabs and scripting        */
  287.     STRPTR bd_UserName;    /* The name the user is registered as                            */
  288.     STRPTR bd_Signature;    /* Signature to use on this BBS, could be a NULL-pointer    */
  289.  
  290.     UWORD  bd_LineLength;/* Max linelength in messages. Overrides TypeData if >0                */
  291.     UBYTE  bd_CharSet;    /* Charset for the grab from this BBS uses. Overrides                    */
  292.                                 /* TypeData if != BRCS_ANY                                                        */
  293.     UBYTE  bd_QuoteType;    /* Prefered quite type for this bbs. See above for definitions.    */
  294.  
  295.     LONGBITS bd_ScrFlags;/* Flags for script (for definitions se TypeData)    */
  296.     LONGBITS bd_Flags;    /* Flags for this BBS                                        */
  297.  
  298.     ULONG  bd_KeepMsg;    /* Messages to keep in each conference                        */
  299.     ULONG  bd_KeepTime;    /* Time (in seconds) to keep messages in conferences    */
  300.  
  301.     STRPTR bd_EMailAddr;    /* The address the user has on the bbs                        */
  302.     STRPTR bd_XpkMethod;    /* What xpk method to use when packing this bbs            */
  303.  
  304.     STRPTR bd_UserStreet;    /* User data to override GlobalConfig        */
  305.     STRPTR bd_UserAddress;  /* NULL equals to value in GlobalConfig    */
  306.     STRPTR bd_UserCountry;
  307.     STRPTR bd_UserPhone;
  308.     STRPTR bd_Alias;            /* Alias used on this BBS. NULL-pointer, no alias    */
  309.                                     /* This alias will only be used in conferences         */
  310.                                     /* marked with CDF_ALIAS.                                             */
  311.     STRPTR bd_DnloadPath;    /* Dnloadpath for this BBS. Overrides global settings        */
  312.     STRPTR bd_TagFile;        /* Tagfile to use on this BBS. NULL-pointer, use global    */
  313.     STRPTR bd_EventArchiver;/* Archiver to use when packing the events from this BBS    */
  314.                                     /* Overrides the setting in the BBSType if non NULL.        */
  315.     STRPTR bd_ReplyPacket;    /* File name of eventual reply packet. Is expected to be */
  316.                                     /* relative to the defined upload dir for this bbs.        */
  317.     STRPTR bd_UploadPath;    /* Upload path for this BBS. Overrides global settings     */
  318.     STRPTR bd_ReplyString;    /* Reply string to use when a message is replied _and_     */
  319.                                     /* moved. NULL means: Use global reply string.                 */
  320.     STRPTR bd_BBSEnterScript;    /* Arexx script to be run each time this bbs is         */
  321.                                         /* entered. Overrides global setting.                        */
  322.     STRPTR bd_BBSLeaveScript;    /* Arexx script to be run each time this bbs is left.    */
  323.                                         /* Overrides global setting.                                    */
  324.     STRPTR bd_ConfEnterScript;    /* Arexx script to be run each time a conference on     */
  325.                                         /* this bbs is entered. Overrides global setting.        */
  326.     STRPTR bd_ConfLeaveScript;    /* Arexx script to be run each time a conference on     */
  327.                                         /* this bbs is left. Overrides global setting.            */
  328.     UBYTE  bd_QuoteChars[4];    /* String to use as quote chars in custom quote type. */
  329.                                         /* Max length is 3. The string is NUL terminated.        */
  330. };
  331.  
  332. /*  BBSData.bd_Flags  */
  333. #define BDF_GLOBAL_KEEPMSG        (1<<0)    /* Use global KeepMsg for this BBS            */
  334. #define BDF_GLOBAL_KEEPTIME    (1<<1)    /* Use global KeepTime for this BBS            */
  335. #define BDF_IGNORE_KEEPMSG        (1<<2)    /* bd_KeepMsg is ignored. Messages won't     */
  336.                                                     /*    be counted when packing conferences        */
  337. #define BDF_IGNORE_KEEPTIME    (1<<3)    /* bd_KeepTime is ignored.    Time won't be    */
  338.                                                     /* checked when packing conferences            */
  339. #define BDF_NO_XPK_METHOD        (1<<4)    /* Don't use any xpk method on this bbs    */
  340.  
  341. /*    This flag is used to show that the events for this bbs has changed since last        *
  342.  *    call to MakeEventPackage(). It is maintained by the library, and should normally    *
  343.  *    not be set or cleard by other. A successfull call to MakeEventPackage() will        *
  344.  *    clear the flag.                                                                                        */
  345. #define BDF_EVENTS_CHANGED        (1<<5)    
  346. #define BDF_NO_SIGNATURE        (1<<6)    /* Don't use signatures on this bbs                */
  347. #define BDF_MARK_OWN_MSGS        (1<<7)    /* Also mark messages from user when adding     */
  348.                                                     /* messages    with the WBRMSG_MarkMessage tag    */
  349. #define BDF_NO_TAGS                (1<<8)    /* Don't use tags on this bbs                        */
  350. #define BDF_ADD_USERS            (1<<9)    /* The parser for this bbs should add users     */
  351.                                                     /* to the database if it supports it.             */
  352. #define BDF_FILE_SIGNATURE        (1<<10)    /* The bd_Signature field contains the path    */
  353.     /* and name of a file containing the signature.                                                */
  354. #define BDF_AUTO_XPK_PACK        (1<<11)    /* Automatically xpk pack new messages when    */
  355.     /* they are written to this bbs. NB: A xpk method must have been defined.            */
  356. #define BDF_NO_AUTO_XPK_PACK    (1<<12)    /* No automatically xpk packing on this bbs.    */
  357.     /* Overrides global flags for auto xpk packing.                                                */
  358. #define BDF_COMMAND_SIGNATURE    (1<<13)    /* The bd_Signature field contains the path    */
  359.     /* and name of a command. When the command is executed should the signature         */
  360.     /* contents be written to stdout. The template for the command is expected to be */    
  361.     /* BBSNAME/K,CONFNAME/K.                                                                             */
  362. #define BDF_REFLOW_QUOTING        (1<<14)    /* Reflow quoting should be on as default     */
  363.     /* when answering messages. This flag should only be considered when                 */
  364.     /* bd_QuoteType is != QT_USE_SUPER.                                                                */
  365. #define BDF_ALWAYS_REPLY_STR    (1<<15)    /* Use reply string on all replies. This         */
  366.     /* flag should only be considered when bd_ReplyString is non NULL.                    */
  367. #define BDF_NO_REPLY_STR        (1<<16)    /* Don't use reply strings on this bbs.         */
  368.                                                     /* Overrides the setting of bd_ReplyString.    */
  369. #define BDF_GLOBAL_REPLY_STR    (1<<17)    /* Use global reply string settings.                        */
  370.     /* Overrides all other bbs reply string settings.                                                        */
  371. #define BDF_NO_BBS_ENTER_SCR    (1<<18)    /* Don't use a bbs enter script on this bbs.                */
  372. #define BDF_NO_BBS_LEAVE_SCR    (1<<19)    /* Don't use a bbs leave script on this bbs.             */
  373. #define BDF_NO_CONF_ENTER_SCR    (1<<20)    /* Don't use a conference enter script on this bbs.    */
  374. #define BDF_NO_CONF_LEAVE_SCR (1<<21)    /* Don't use a conference leave script on this bbs.    */
  375. #define BDF_ENCODE_8BIT_MAIL    (1<<22)  /* Encode 8 bits messages in mail conferences. Only     */
  376.     /* appliable when the TDF_SUPPORTS_ENCODE_8BIT_MAIL flag is set for the bbstype.                */
  377. #define BDF_ENCODE_8BIT_MSGS    (1<<23)  /* Encode 8 bits messages in public conferences. Only */
  378.     /* appliable when the TDF_SUPPORTS_ENCODE_8BIT_MSGS flag is set for the bbstype.                */
  379.  
  380.  
  381. /*  Structure holding BBS data maintained by the library */
  382.  
  383. struct BBSInternal
  384. {
  385.     ULONG bi_FirstEvent;    /* First event for this BBS                                */
  386.     ULONG bi_LastEvent;    /* Last event for this BBS                                    */
  387.     ULONG bi_NumEvents;    /* Number of active events (not deleted or done)    */
  388.  
  389.     ULONG bi_FirstUser;    /* First user in userfile                    */
  390.     ULONG bi_LastUser;    /* Last user in userfile                    */
  391.     ULONG bi_NumUsers;    /* Number of active users in userfile    */
  392.  
  393.     ULONG bi_FirstKill;    /* First kill in killfile                    */
  394.     ULONG bi_LastKill;    /* Number of last kill in killfile         */
  395.     ULONG bi_NumKills;    /* Number of active kills in killfile    */
  396.  
  397.     ULONG bi_SumMarked;    /* Nr of marked messages on this BBS                            */
  398.                                 /* This field should be regarded as a BOOL until you         */
  399.                                 /* have obtained a conference list for the bbs.                */
  400.                                 /* This field will only be updated during UpdateStruct()    */
  401.     ULONG bi_SumM2User;    /* Nr of marked messages on this BBS to the user            */
  402.                                 /* This field should be regarded as a BOOL until you         */
  403.                                 /* have obtained a conference list for the bbs.                */
  404.                                 /* This field will only be updated during UpdateStruct()    */
  405. };
  406.  
  407.  
  408. /*  Structure used in List returned by GetBBSList  */
  409.  
  410. struct BBSListItem
  411. {
  412.     struct Node bl_Node;    /* Caller is free to use nl_Name        */
  413.     WORD bl_pad;
  414.     APTR bl_Link;            /* Private!!!!!!!!                                    */
  415.     APTR bl_UserData;        /* For use by the caller; no restrictions!     */
  416.  
  417.     struct BBSData     *bl_Data;        /* Pointer to the BBS data                    */
  418.     struct BBSInternal *bl_Internal;    /* Pointer to public internal data        */
  419.  
  420.     STRPTR bl_BBSPath;    /* Path to the data directory for this BBS    */
  421.                                 /* Used for textfiles. Ends with a '/'            */
  422.     ULONG  bl_ChangeCnt;    /* Private!!!!!!!!                                    */
  423. };
  424.  
  425.  
  426. /***********************************************************************
  427. *
  428. * Conference structures and definitions
  429. *
  430. */
  431.  
  432. /*  Structure holding general conference data  */
  433.  
  434. struct ConfData
  435. {
  436.     STRPTR   cd_Name;            /* Name of Conference                */
  437.     ULONG    cd_KeepMsg;        /* Max number of messages to keep            */
  438.     ULONG    cd_KeepTime;    /* Oldest msg to keep (time in seconds)                    */
  439.     STRPTR   cd_Signature;    /* Signature for conference, could be a NULL-pointer    */
  440.     STRPTR   cd_Alias;        /* Alias used in conference, NULL pointer, no alias        */
  441.     LONG     cd_BBSConfNr;    /* The internal number a conference has on the BBS            */
  442.     UWORD      cd_LineLength;    /* Max linelength in messages. Overrides BBSData if > 0    */
  443.     UBYTE      cd_CharSet;        /* Charset for the grab from this conf. Overrides            */
  444.                                     /* BBSData if != BRCS_ANY                                            */
  445.     UBYTE    cd_QuoteType;    /* Prefered quite type for this conf. See above for         */
  446.                                     /* definitions.                                                        */
  447.     LONGBITS cd_Flags;    
  448.  
  449.     STRPTR cd_XpkMethod;        /* What xpk method to use when packing this conference            */
  450.     STRPTR cd_TagFile;        /* Tagfile to use in this conf. NULL-pointer, use bbs                */
  451.     STRPTR cd_EMailAddr;        /* The Email address the user has in this conference. For use    */
  452.                                     /* on bbses where the user is member of more than one net.        */
  453.     STRPTR cd_ReplyString;    /* Reply string to use when a message is replied _and_            */
  454.                                         /* moved. NULL means: Use bbs reply string.                         */
  455.     STRPTR cd_ConfEnterScript;    /* Arexx script to be run each time this conference     */
  456.                                         /* is entered. Overrides bbs setting.                        */
  457.     STRPTR cd_ConfLeaveScript;    /* Arexx script to be run each time this conference     */
  458.                                         /* is left. Overrides bbs setting.                            */
  459.     UBYTE  cd_QuoteChars[4];    /* String to use as quote chars in custom quote type. */
  460.                                         /* Max length is 3. The string is NUL terminated.        */
  461.     UBYTE  cd_ConfNetType;        /* States which type of net the conference is on. To     */
  462.         /* be used on bbses of bbstypes which support serveral nettypes. Should only     */
  463.         /* be set by parser/packer for the bbstype. Se below for defines.                    */
  464.     UBYTE  cd_reserved[3];    
  465. };
  466.  
  467.  
  468. /*  ConfData.cd_Flags  */
  469.  
  470. #define CDF_MEMBER_OF            (1<<0)    /* Member of this conference    */
  471. #define CDF_MAIL                    (1<<1)    /* Mail conference                */
  472. #define CDF_READ_ONLY            (1<<2)    /* Read only conference            */
  473. #define CDF_COMPULSORY            (1<<3)    /* Compulsory conference        */
  474. #define CDF_FILE_INFO            (1<<4)    /* File info conference            */
  475. #define CDF_USER_INFO            (1<<5)    /* User info conference            */
  476. #define CDF_PRIVATE_ALLOWED    (1<<6)    /* Private messages allowed    */
  477. #define CDF_ENTER_ONLY_TO_ALL    (1<<7)    /* Enter only allowed to ALL    */
  478. #define CDF_ALIAS                    (1<<8)    /* Alias conference                */
  479. #define CDF_BBS_KEEPMSG            (1<<9)    /* Use BBS KeepMsg for this Conf        */
  480. #define CDF_BBS_KEEPTIME        (1<<10)    /* Use BBS KeepTime for this Conf    */
  481. #define CDF_IGNORE_KEEPMSG        (1<<11)    /* cd_KeepMsg is ignored. Messages won't     */
  482.                                                     /*    be counted when packing conference        */
  483. #define CDF_IGNORE_KEEPTIME    (1<<12)    /* cd_KeepTime is ignored.    Time won't be    */
  484.                                                     /* checked when packing conference            */
  485. #define CDF_NO_XPK_METHOD        (1<<13)    /* Don't use any xpk method on this conf    */
  486. #define CDF_NO_SIGNATURE        (1<<14)    /* Don't use any signature in this conf    */
  487. #define CDF_NOT_ON_BBS            (1<<15)    /* This conference is not on the BBS        */
  488. #define CDF_NO_TAGS                (1<<16)    /* Don't use message tags in this conf        */
  489. #define CDF_REPLY_ONLY_TO_ALL (1<<17)    /* Replies should be adresses to all        */
  490.     /* If both CDF_REPLY_ONLY_TO_ALL and CDF_ENTER_ONLY_TO_ALL flags is set are     */
  491.     /* all messages in the conference addressed to all.                                    */
  492. #define CDF_NO_LINEWRAP_DISPLAY (1<<18) /* Don't line wrap messages in this         */
  493.     /* conference when they are displayed. Should be used for conferences with     */
  494.     /* messages with ansi-codes. Typical conferences are conferences which are     */
  495.     /* used to display bulletins from the bbs.                                                */
  496. #define CDF_FILE_SIGNATURE        (1<<19)    /* The cd_Signature field contains the     */
  497.     /* path and name of a file containing the signature.                                    */
  498. #define CDF_AUTO_XPK_PACK        (1<<20)    /* Automatically xpk pack new messages     */
  499.     /* when they are written to this conference. NB: A xpk method must have been    */
  500.     /* defined.                                                                                            */
  501. #define CDF_NO_AUTO_XPK_PACK    (1<<21)    /* No automatically xpk packing in this     */
  502.     /* conference. Overrides bbs og global flags for auto xpk packing.                 */
  503. #define CDF_MARK_OWN_MSGS        (1<<22)    /* Also mark messages from user when         */
  504.     /* adding messages with the WBRMSG_MarkMessage tag in this conference.            */
  505. #define CDF_COMMAND_SIGNATURE    (1<<23)    /* The cd_Signature field contains the path    */
  506.     /* and name of a command. When the command is executed should the signature         */
  507.     /* contents be written to stdout. The template for the command is expected to be */    
  508.     /* BBSNAME/K,CONFNAME/K.                                                                             */
  509. #define CDF_REFLOW_QUOTING     (1<<24)    /* Reflow quoting should be on as default     */
  510.     /* when answering messages. This flag should only be considered when                 */
  511.     /* cd_QuoteType is != QT_USE_SUPER.                                                                */
  512. #define CDF_ALWAYS_REPLY_STR    (1<<25)    /* Use reply string on all replies. This         */
  513.     /* flag should only be considered when cd_ReplyString is non NULL.                   */
  514. #define CDF_NO_REPLY_STR        (1<<26)    /* Don't use reply strings in this conf.         */
  515.                                                     /* Overrides the setting of cd_ReplyString.    */
  516. #define CDF_BBS_REPLY_STR        (1<<27)    /* Use bbs reply string settings.                 */
  517.     /* Overrides all other conference reply string settings.                                    */
  518. #define CDF_NO_CONF_ENTER_SCR     (1<<28)    /* Don't use a conference enter script in this conference.    */
  519. #define CDF_NO_CONF_LEAVE_SCR  (1<<29)    /* Don't use a conference leave script on this conference.    */
  520. #define CDF_FORCE_PACK_REWRITE (1<<30)    /* Force a rewrite next time this conference */
  521.     /* is packed. If the packing succeed will the flagg be cleared.                        */
  522.  
  523.  
  524. /*  ConfData.cd_ConfNetType  */ 
  525.  
  526. #define CDNT_NONET            0    /* This conference is a local conference.    This is the    */
  527.                                         /* default values for new conferences.                     */
  528. #define CDNT_FIDONET            1    /* This conference is a Fido net conference.                */
  529. #define CDNT_USENET            2    /* This conference is a usenet conference.                */
  530.  
  531.  
  532. /*  Structure holding conference data maintained by the library */
  533.  
  534. struct ConfInternal
  535. {
  536.     ULONG ci_FirstMsg;    /* First message in conference                    */
  537.     ULONG ci_LastMsg;        /* Last message in conference                        */
  538.     ULONG ci_NumMessages;/*    Number of active messages in conference    */
  539.     ULONG ci_MsgMarked;    /* Number of messages marked                        */
  540.     ULONG ci_Marked2User;/* Number of marked messages to user            */
  541. };
  542.  
  543.  
  544. /*  Structure used in List returned by GetConfList  */
  545.  
  546. struct ConfListItem
  547. {
  548.     struct Node cl_Node;    /* Caller is free to use nl_Name        */
  549.     WORD cl_pad;
  550.     APTR cl_Link;            /* Private!!!!!!!!                                    */
  551.     APTR cl_UserData;        /* For use by the caller; no restrictions!    */
  552.     
  553.     struct ConfData     *cl_Data;        /* Pointer to the conference data    */
  554.     struct ConfInternal *cl_Internal;/* Pointer to public internal data    */
  555.  
  556.     ULONG cl_ChangeCnt;    /* Private!!!!!!!!    */
  557. };
  558.  
  559.  
  560. /***********************************************************************
  561. *
  562. * File area structures and definitions
  563. *
  564. */
  565.  
  566. /*  Structure holding general file area data  */
  567.  
  568. struct FAreaData
  569. {
  570.     STRPTR ad_Name;        /* Name of file area                                */
  571. };
  572.  
  573.  
  574. /*  Structure holding file area data maintained by the library */
  575.  
  576. struct FAreaInternal
  577. {
  578.     ULONG ai_FirstFile;    /* Number of the first file in this area    */
  579.     ULONG ai_NumFiles;    /* Number of files in this area                 */
  580. };
  581.  
  582.  
  583. /*  Structure used in List returned by GetFAreaList  */
  584.  
  585. struct FAreaListItem
  586. {
  587.     struct Node al_Node;    /* Caller is free to use nl_Name                    */
  588.     WORD al_pad;
  589.     APTR al_Link;            /* Private!!!!!!!!                                    */
  590.     APTR al_UserData;        /* For use by the caller; no restrictions!    */
  591.     
  592.     struct FAreaData     *al_Data;        /* Pointer to the file area data        */
  593.     struct FAreaInternal *al_Internal;    /* Pointer to public internal data    */
  594.  
  595.     ULONG al_ChangeCnt;    /* Private!!!!!!!!                    */
  596. };
  597.  
  598.  
  599. /***********************************************************************
  600. *
  601. * Passive Conference list structures and definitions
  602. *
  603. */
  604.  
  605. struct PassConfListItem
  606. {
  607.     struct Node pl_Node;        /* Caller is free to use nl_Name                */
  608.     WORD pl_pad;
  609.  
  610.     STRPTR   pl_Name;            /* Must always be set.                                    */
  611.     STRPTR   pl_Description;/* NULL equals no available description            */
  612.     LONG     pl_BBSConfNr;    /* The internal number the conf has on the bbs    */
  613.     LONGBITS pl_Flags;        /* Same as CondData.cd_Data.                            */
  614. };
  615.  
  616. /***********************************************************************
  617. *
  618. * Message, event, user, kill, file flags and definitions.
  619. *
  620. */
  621.  
  622. /*  Message flags (Returned by GBRMSG_Flags tag)  */
  623.  
  624. #define MDF_READ                (1<<0)    /* Message is read        */
  625. #define MDF_REPLIED            (1<<1)    /* Message is replied    */
  626. #define MDF_PRIVATE            (1<<2)    /* Message is private            */
  627. #define MDF_TO_USER            (1<<3)    /* Message is to the user        */
  628. #define MDF_FROM_USER        (1<<4)    /* Message is from the user    */
  629. #define MDF_DELETED            (1<<5)    /* Message is deleted                                 */
  630. #define MDF_UNRECOVERABLE    (1<<6)    /* Message is can not be undeleted                */
  631. #define MDF_KEEP                (1<<7)    /* Keep message. Message will not be deleted    */
  632.                                                 /* during packing of conference                     */
  633. #define MDF_TO_ALL            (1<<8)    /* Message is to all (has no reciever)            */
  634. #define MDF_XPK_TEXT            (1<<9)    /* Message text is Xpk'ed (Private flag)        */
  635. #define MDF_MARKED            (1<<10)    /* Message is marked    (Private flag)                */
  636. #define MDF_URGENT            (1<<11)    /* Message is urgent                                    */
  637. #define MDF_IMPORTANT        (1<<12)    /* Message is important                                */
  638. #define MDF_SUPERMARKED        (1<<13)  /* Message will not be unmarked as long as this flag is set.    */
  639.  
  640. #define MDF_BINARY_PARTS    (1<<14)    /* Message contains 1 or more BRMSG_BinaryPart tags    */
  641. #define MDF_TEXT_PARTS        (1<<15)    /* Message contains 1 or more BRMSG_TextPart tags        */
  642.     /* These two flags does also concern possible message parts.                                    */
  643.  
  644. #define MDF_MESSAGE_PARTS    (1<<16)    /* Message contains 1 or more BRMSG_MsgPart tags        */
  645. #define MDF_CONFIDENTIAL    (1<<17)    /* Message is confidential                                        */
  646.  
  647. #define MDF_HAZE_BIT0        (1<<24)    /* Use MsgHazeLevel macro to extract haze     */
  648. #define MDF_HAZE_BIT1        (1<<25)  /* level from message flags.                        */
  649. #define MsgHazeLevel(msgflags) ((msgflags & (MDF_HAZE_BIT0 | MDF_HAZE_BIT1)) >> 24)
  650.  
  651.  
  652. /*  Event flags (Returned by RBREV_Flags tag)  */
  653. #define EDF_DELETED            (1<<0)    /* Event is deleted    */
  654. #define EDF_PACKED            (1<<1)    /* Event is packed    */
  655. #define EDF_DONE                (1<<2)    /* Event is done                                */
  656. #define EDF_ERROR                (1<<3)    /* Error performing this event            */
  657. #define EDF_UNRECOVERABLE    (1<<4)    /* Event can not be undeleted                                                    */
  658. #define EDF_FREEZE            (1<<5)    /* Event is frozen. Will not be done as long as this flag is set.    */
  659.  
  660.  
  661. /*  Event types supported   */
  662.  
  663. #define EVE_ENTERMSG            0L        /* Enter message        */
  664. #define EVE_REPLYMSG            1L        /* Reply message        */
  665. #define EVE_JOINCONF            2L        /* Join conference    */
  666. #define EVE_RESIGNCONF        3L        /* Resign conference    */
  667. #define EVE_DOWNLOAD            4L        /* Download file        */
  668. #define EVE_UPLOAD            5L        /* Upload file            */
  669. #define EVE_CONFLIST            6L        /* Get conflist                                    */
  670. #define EVE_CONFIGUREBBS    7L        /* Set correct configuration on the bbs.    */
  671. #define EVE_SENDUSERINFO    8L        /* Send userinfo                                    */
  672. #define EVE_GETMESSAGES        9L        /* Get specified messages                */
  673. #define EVE_GETNEWFILES        10L    /* Get new files listing                */
  674. #define EVE_DOCOMMAND        11L    /* Command the script should do        */
  675. #define EVE_AUTOLOGOFF        12L    /* Autologoff on next session            */
  676. #define EVE_RETRACTMSG        13L    /* Retract message from bbs            */
  677. #define EVE_RETRACTFILE        14L    /* Retract file from bbs                */
  678. #define EVE_MAXEVENT            15L
  679.  
  680.  
  681. /*  User flags (Returned by RBRUSR_Flags tag)  */
  682. #define UDF_DELETED            (1<<0)    /* User is deleted                */
  683. #define UDF_UNRECOVERABLE    (1<<1)    /* User can not be undeleted    */
  684.  
  685.  
  686. /*  Kill flags (Returned by RBRK_Flags tag)  */
  687. #define KDF_DELETED            (1<<0)    /* Kill is deleted    */
  688. #define KDF_UNRECOVERABLE  (1<<1)    /* Kill can not be undeleted  */
  689. #define KDF_MARK_KEEP        (1<<2)    /* Mark message with MDF_KEEP if matched    */
  690. #define KDF_MARK_URGENT        (1<<3)    /* Mark message with MDF_URGENT if matched  */
  691. #define KDF_MARK_IMPORTANT    (1<<4)    /* Mark message with MDF_IMPORTANT if matched */
  692.  
  693. #define KDF_MARK_HAZE_BIT0    (1<<24)    /* Use KillHazeLevel macro to extract haze    */
  694. #define KDF_MARK_HAZE_BIT1    (1<<25)  /* level from kill flags.                            */
  695.  
  696. #define KillHazeLevel(killflags) ((killflags & (KDF_MARK_HAZE_BIT0 | KDF_MARK_HAZE_BIT1)) >> 24)
  697.  
  698.  
  699. /*  File flags (Returned by RBRF_Flags tag)  */
  700. #define FDF_DELETED            (1<<0)    /* File is deleted            */
  701. #define FDF_UNRECOVERABLE    (1<<1)    /* File is unrecoverable    */
  702.  
  703.  
  704.  
  705. /***********************************************************************
  706. *
  707. *  Search result structures and definitions.
  708. *
  709. */
  710.  
  711. struct SearchResult    /* Structure returned from SearchBRMessage()  */
  712. {
  713.     struct SearchResult *sr_NextResult;    /* Link to next SearchResult    */
  714.     ULONG sr_MsgsFound;        /* Number of messagenumbers in the buffer    */
  715.     ULONG *sr_Messages;        /* Buffer holding the messagenumbers        */
  716.                                     /* NULL-terminated.                                */
  717. };
  718.  
  719.  
  720. struct UserSuggestion    /* Structure returned from SearchBRUser()    */
  721. {
  722.     struct Node us_Node;        /* us_Node.ln_Name contains the name of the user    */
  723.     ULONG us_UserNr;            /* Number of user found                                        */
  724. };
  725.  
  726.  
  727. struct FoundFile
  728. {
  729.     ULONG ff_FileNr;                        /* Number of file found                                */
  730.     struct FAreaListItem *ff_FArea;    /* File area file belongs to. This is a list    */
  731.                                                 /* item from the SBRF_SearchFAreaList or the    */
  732.                                                 /* SBRF_SearchFArea.                                 */
  733. };
  734.  
  735. struct SFileResult    /* Structure returned by SearchBRFile()    */
  736. {
  737.     struct SFileResult *fr_NextResult;    /* Link to next SFileResult                    */
  738.     ULONG fr_FilesFound;                        /* Number of files in *this* SFileResult    */
  739.     struct FoundFile *fr_Files;            /* Buffer holding FoundFile structures        */
  740. };
  741.  
  742.  
  743. struct FoundUser
  744. {
  745.     ULONG fu_UserNr;        /* Number of user found                                            */
  746.     ULONG fu_FoundInTag;    /* In which tag the search string was found first in    */
  747. };
  748.  
  749. struct SUserResult    /* Structure returned by SearchBRUser()    */
  750. {
  751.     struct SUserResult *ur_NextResult;    /* Link to next SUserResult                    */
  752.     ULONG ur_UsersFound;                        /* Number of users in *this* SUserResult    */
  753.     struct FoundUser *ur_Users;            /* Buffer holding FoundUser structures        */
  754. };
  755.  
  756.  
  757.  
  758. /***********************************************************************
  759. *
  760. *  Structure returned with data about user.
  761. *
  762. */
  763.  
  764. struct UserData        /* Structure returned by BBSUserData()    */
  765. {
  766.     STRPTR ud_Name;
  767.     STRPTR ud_Street;
  768.     STRPTR ud_Address;
  769.     STRPTR ud_Country;
  770.      STRPTR ud_Phone;        /* May be NULL    */
  771. };
  772.  
  773.  
  774. /***********************************************************************
  775. *
  776. *  Structures passed to callback hooks.
  777. *
  778. */
  779. #define DEF_PROGRESS_UPDATES    100    /* Default progress callbacks on each pass    */
  780.  
  781. /* 
  782.     Prototype for the progress callback hook function should be: 
  783.  
  784.     ULONG __saveds __asm DoBRProgress(register __a0 struct Hook *hook, 
  785.         register __a2 struct BRProgress *progress, register __a1 APTR message);
  786.  
  787.     No messages defined yet. The messages parameter will always be NULL;
  788. */
  789.  
  790. struct BRProgress    /* Structure passed as object to the different progress callback hooks     */
  791. {
  792.     ULONG brp_Pass;    /* Some operations are done in more than one pass        */
  793.     ULONG brp_First;    /* First object in this pass.                                    */
  794.     ULONG brp_Last;    /* Last object in this pass.                                    */
  795.                             /* brp_First may be greater than brp_Last!                */
  796.     ULONG brp_Current;/* Current object.                                                */
  797.     ULONG brp_Actions;/* How many objects so far which has been altered.        */
  798.     ULONG brp_Skip;    /* How manu objects done between each call to the hook. (read only)    */
  799.     ULONG brp_LastPass; /* Is set to the value of brp_Pass had the last call to the hook.    */
  800.                         /* Is 0 in first call to hook                                                    */
  801. };
  802.  
  803. #endif /* LIBRARIES_BBSREAD_H */
  804.